<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
        <cc:attribute name="duplicate" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>

        <h:outputStylesheet library="css" name="paySheet.css" ></h:outputStylesheet>
        <div style="position: relative!important;
             /*padding-left: 0.5%!important;*/
             height:100%!important;
             width:100%!important; 
             /*             overflow:hidden!important; */
             font-family: Times New Roman!important; 
             font-size: 10px!important; 
             margin:1px!important; 
             padding: 1px!important;
             /*             background-size: 100% auto!important;*/
             letter-spacing: 0px;
             /*             border: 1px solid!important;*/">

            <div class="institutionName" style="text-align: center!important;
                 font-weight: bold!important;
                 font-size: 15px!important;
                 font-weight: bold;">

            </div>
            <div style="font-size: 10px!important; font-family: Times New Roman!important; letter-spacing: 0px;">
                <table>

                    <tr>
                        <td>
                            <h:outputLabel value="#{cc.attrs.bill.institution.transAddress1}"/>
                            <br/>
                            <h:outputLabel value="#{cc.attrs.bill.institution.transAddress2}"/>
                            <br/>
                            <h:outputLabel value="#{cc.attrs.bill.institution.transAddress3}"/>
                            <br/>
                            <h:outputLabel value="#{cc.attrs.bill.institution.transAddress4}"/>
                            <br/>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="#{commonController.currentDateTime}">
                                <f:convertDateTime pattern="yyyy/MMM/dd" />
                            </h:outputLabel>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputLabel value="The Manager,"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.string}"/>
                        </td>
                        <td></td>

                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.transAddress1},"/>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.transAddress2}"/>
                            <h:outputLabel value="." rendered="#{staffSalaryController.reportKeyWord.transAddress3 eq null or staffSalaryController.reportKeyWord.transAddress3 eq ''}"/>
                            <h:outputLabel value="," rendered="#{staffSalaryController.reportKeyWord.transAddress3 ne null and staffSalaryController.reportKeyWord.transAddress3 ne ''}"/>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.transAddress3}"/>
                            <h:outputLabel value="." rendered="#{(staffSalaryController.reportKeyWord.transAddress4 eq null or staffSalaryController.reportKeyWord.transAddress4 eq '') and (staffSalaryController.reportKeyWord.transAddress3 ne null and staffSalaryController.reportKeyWord.transAddress3 ne '')}"/>
                            <h:outputLabel value="," rendered="#{staffSalaryController.reportKeyWord.transAddress4 ne null and staffSalaryController.reportKeyWord.transAddress4 ne ''}"/>
                        </td>
                        <td></td>
                        <td></td>
                    </tr><tr>
                        <td>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.transAddress4}"/>
                            <h:outputLabel value="." rendered="#{staffSalaryController.reportKeyWord.transAddress4 ne null and staffSalaryController.reportKeyWord.transAddress4 ne ''}"/>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td colspan="3">
                            <h:outputLabel value="At the request of #{cc.attrs.bill.staff.person.nameWithTitle}"/>
                        </td>

                    </tr>

                    <tr>
                        <td colspan="3">
                            <h:outputLabel value="(Pivate Address #{cc.attrs.bill.staff.person.address})"/>
                        </td>

                    </tr>

                    <tr>
                        <td colspan="3">
                            <h:outputLabel value="who is employed by us, we append below the particulars of his/her salary and deductions."/>
                            <h:outputLabel value="#{staffSalaryController.reportKeyWord.salaryCycle.salaryFromDate}" >
                                <f:convertDateTime pattern="yyyy-MMMM" />
                            </h:outputLabel>
                        </td>

                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Basic Salary + BR" style="text-align: left;"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.basicValue}">                                 
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Mercantile Day Allowance" style="text-align: left;" rendered="#{cc.attrs.bill.merchantileAllowanceValue ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.merchantileAllowanceValue ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.merchantileAllowanceValue}" rendered="#{cc.attrs.bill.merchantileAllowanceValue ne 0.0}">      
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Poya Day Allowance" style="text-align: left;" rendered="#{cc.attrs.bill.poyaAllowanceValue ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.poyaAllowanceValue ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.poyaAllowanceValue}" rendered="#{cc.attrs.bill.poyaAllowanceValue ne 0.0}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Day Off Allowance" style="text-align: left;" rendered="#{cc.attrs.bill.dayOffAllowance ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.dayOffAllowance ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.dayOffAllowance}" rendered="#{cc.attrs.bill.dayOffAllowance ne 0.0}"> 
                                <f:convertNumber pattern="#,##0.00" />                                
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Basic Adjustment" style="text-align: left;" rendered="#{cc.attrs.bill.adjustmentToBasic ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.adjustmentToBasic ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.adjustmentToBasic}" rendered="#{cc.attrs.bill.adjustmentToBasic ne 0.0}">   
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="No Pay Basic" style="text-align: left;" rendered="#{cc.attrs.bill.noPayValueBasic ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.noPayValueBasic ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.noPayValueBasic}" rendered="#{cc.attrs.bill.noPayValueBasic ne 0.0}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="Allowance Adjustment" style="text-align: left;" rendered="#{cc.attrs.bill.adjustmentToAllowance ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.adjustmentToAllowance ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.adjustmentToAllowance}" rendered="#{cc.attrs.bill.adjustmentToAllowance ne 0.0}"> 
                                <f:convertNumber pattern="#,##0.00" />                                
                            </h:outputText>
                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="No Pay Allowance" style="text-align: left;" rendered="#{cc.attrs.bill.noPayValueAllowance ne 0.0}"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":" rendered="#{cc.attrs.bill.noPayValueAllowance ne 0.0}"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.noPayValueAllowance}" rendered="#{cc.attrs.bill.noPayValueAllowance ne 0.0}">     
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputText>
                        </td>
                    </tr>
                    <ui:repeat var="we" value="#{cc.attrs.bill.transStaffSalaryComponantsAddition}">
                        <tr>
                            <td style="text-align: left;">
                                <h:outputText value="#{we.staffPaysheetComponent.paysheetComponent.name}" rendered="#{we.componantValue ne 0.0}"/> 
                                <h:outputText value="( " rendered="#{we.staffPaysheetComponent.paysheetComponent.componentType eq 'PerformanceAllowance' and we.componantValue ne 0.0}" />
                                <h:outputText value="#{we.staffPaysheetComponentPercentage.staffPaySheetComponentValue}" rendered="#{we.staffPaysheetComponent.paysheetComponent.componentType eq 'PerformanceAllowance' and we.componantValue ne 0.0}">
                                    <f:convertNumber pattern="##0" />
                                </h:outputText>
                                <h:outputText value="% )" rendered="#{we.staffPaysheetComponent.paysheetComponent.componentType eq 'PerformanceAllowance' and we.componantValue ne 0.0}"/>
                            </td>
                            <td></td>
                            <td style="text-align: right;">
                                <h:outputText value="#{we.componantValue}" rendered="#{we.componantValue ne 0.0}" >
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputText>
                            </td>
                        </tr>
                    </ui:repeat>
                    <tr>
                        <td>
                            <h:outputLabel value="Gross Pay"/>
                        </td>
                        <td></td>
                        <td style="text-align: right;">
                            <h:outputLabel value="#{cc.attrs.bill.transEpfEtfDiductableSalary+cc.attrs.bill.transTotalAllowance}" style="text-align: right;  border-bottom: 1px solid black; border-top: 1px solid black;">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>


                    <tr>
                        <td>
                            <h:outputLabel value="Deductions:"/>
                        </td>
                        <td></td>
                        <td>

                        </td>
                    </tr>

                    <tr>
                        <td style="text-align: left;">
                            <h:outputText value="EPF Staff 8%" style="text-align: left;"/> 
                        </td>
                        <td>
                            <h:outputLabel value=":"/>
                        </td>
                        <td style="text-align: right;">
                            <h:outputText value="#{cc.attrs.bill.epfStaffValue}"> 
                                <f:convertNumber pattern="#,##0.00" />                                
                            </h:outputText>
                        </td>
                    </tr>

                    <ui:repeat var="t" value="#{cc.attrs.bill.transStaffSalaryComponantsSubtraction}">
                        <tr>
                            <td style="text-align: left;">
                                <h:outputText value="#{t.staffPaysheetComponent.paysheetComponent.name}" rendered="#{t.componantValue ne 0.0}"/> 
                            </td>
                            <td>
                                <h:outputLabel value=":" rendered="#{t.componantValue ne 0.0}"/>
                            </td>
                            <td style="text-align: right;">
                                <h:outputText value="#{t.componantValue}" rendered="#{t.componantValue ne 0.0}">
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputText>
                            </td>
                        </tr>
                    </ui:repeat>

                    <tr>
                        <td>
                            <h:outputLabel value="Net Pay"/>
                        </td>
                        <td></td>
                        <td style="text-align: right;">
                            <h:outputLabel value="#{cc.attrs.bill.transNetSalry}" style="text-align: right;  border-bottom: 1px solid black; border-top: 1px solid black;">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel> 
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td colspan="3">
                            <p>
                                <h:outputLabel value="The above named is employed as a #{cc.attrs.bill.staff.speciality} and "/>
                                <p:outputLabel value="He" rendered="#{cc.attrs.bill.staff.person.sex eq 'Male'}"/>
                                <p:outputLabel value="She" rendered="#{cc.attrs.bill.staff.person.sex eq 'Female'}"/>
                                <h:outputLabel value=" pay sheet/Service No. is #{cc.attrs.bill.staff.code} "/>
                            </p>
                        </td>

                    </tr>
                    <tr>
                        <td colspan="3">
                            <p>
                                <h:outputLabel value="and "/>
                                <p:outputLabel value="He" rendered="#{cc.attrs.bill.staff.person.sex eq 'Male'}"/>
                                <p:outputLabel value="She" rendered="#{cc.attrs.bill.staff.person.sex eq 'Female'}"/>
                                <h:outputLabel value=" is due to retire on "/>
                                <h:outputLabel value="#{commonController.retiermentDate(cc.attrs.bill.staff.person.dob)}" rendered="#{cc.attrs.bill ne null}">
                                    <f:convertDateTime pattern="yyyy MMM dd" />
                                </h:outputLabel>
                                <p:outputLabel value=". He" rendered="#{cc.attrs.bill.staff.person.sex eq 'Male'}"/>
                                <p:outputLabel value="She" rendered="#{cc.attrs.bill.staff.person.sex eq 'Female'}"/>
                                <h:outputLabel value=" has been in the permanent."/>
                            </p>
                        </td>

                    </tr>
                    <tr>
                        <td colspan="3">
                            <p>
                                <h:outputLabel value="Sevice Since "/>
                                <h:outputLabel value="#{cc.attrs.bill.staff.dateJoined}">
                                    <f:convertDateTime pattern="yyyy MMM dd" />
                                </h:outputLabel>
                                <h:outputLabel value=" The above information is Certified correct."/>
                            </p>
                        </td>

                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="10"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="Name"/>
                        </td>
                        <td></td>
                        <td>
                            <h:outputLabel value=":...................................................."/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="Designation"/>
                        </td>
                        <td></td>
                        <td>
                            <h:outputLabel value=":...................................................."/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputLabel value="Date"/>
                        </td>
                        <td></td>
                        <td>
                            <h:outputLabel value=":...................................................."/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p:spacer height="20"/>
                        </td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>
                            <h:outputLabel value="Signature over Official Rubber Stamp"/>
                        </td>
                        <td></td>
                        <td>
                            <h:outputLabel value=":...................................................."/>
                        </td>
                    </tr>

                </table>

            </div>
        </div>
    </cc:implementation>
</html>